﻿using System;

namespace Informant.Clients
{
	public class SelectableItem<T> : BindableObject
	{
		Boolean _isSelected;
		T _target;

		/// <summary>
		/// Gets or sets a value indicating whether this instance is selected.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is selected; otherwise, <c>false</c>.
		/// </value>
		public Boolean IsSelected
		{
			get { return _isSelected; }
			set
			{
				_isSelected = value;
				PropertyChange("IsSelected");
			}
		}
		/// <summary>
		/// Gets the target.
		/// </summary>
		/// <value>The target.</value>
		public T Target
		{
			get { return _target; }
			private set
			{
				_target = value;
				PropertyChange("Target");
			}
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="SelectableItem&lt;T&gt;"/> class.
		/// </summary>
		/// <param name="target">The target.</param>
		public SelectableItem(T target)
		{
			Target = target;
		}
	}
}
